﻿using Dapper;
using System;
using BCEntity.Sim.Company.JobTitle;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading.Tasks;

namespace BCData.Sim.Company.JobTitle
{
	/// <summary>
	/// 职位
	/// </summary>
	public interface IJobTitleData
	{
		#region  成员方法
		/// <summary>
		/// 是否存在该记录
		/// </summary>
		/// <param name="jobTitleId">职位Id</param>
		Task<bool> Exists(int jobTitleId);
		/// <summary>
		/// 是否存在该记录
		/// </summary>
		/// <param name="jobTitleNo">职位编号</param>
		Task<bool> Exists(string jobTitleNo);
		/// <summary>
		/// 增加职位
		/// </summary>
		/// <param name="entity">职位信息</param>
		Task<JobTitleEntity> Add(JobTitleEntity entity);
		/// <summary>
		/// 更新职位
		/// </summary>
		/// <param name="entity">职位信息</param>
		Task<JobTitleEntity> Update(JobTitleEntity entity);
		/// <summary>
		/// 删除职位
		/// </summary>
		/// <param name="jobTitleId">职位Id</param>
		Task<bool> Delete(int jobTitleId);
		/// <summary>
		/// 获取职位
		/// </summary>
		/// <param name="jobTitleId">职位Id</param>
		Task<JobTitleEntity> GetEntity(int jobTitleId);
		/// <summary>
		/// 获取职位
		/// </summary>
		/// <param name="jobTitleNo">职位编号</param>
		Task<JobTitleEntity> GetEntity(string jobTitleNo);
		/// <summary>
		/// 获取职位列表
		/// </summary>
		Task<IEnumerable<JobTitleEntity>> GetList();
		/// <summary>
		/// 获取职位分页列表
		/// </summary>
		/// <param name="jobTitle">职位名称</param>
		/// <param name="enabled">启用</param>
		/// <param name="start">开始时间</param>
		/// <param name="end">结束时间</param>
		/// <param name="sortName">排序字段</param>
		/// <param name="ascending">升序</param>
		/// <param name="pageIndex">当前页码</param>
		/// <param name="pageSize">每页数据条数</param>
		Task<(IEnumerable<JobTitleEntity>, int)> Query(string jobTitle,bool? enabled, DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
		/// <summary>
		/// 启用职位
		/// </summary>
		/// <param name="jobTitleId">职位Id</param>
		Task<bool> Enabled(int jobTitleId);
		/// <summary>
		/// 禁用职位
		/// </summary>
		/// <param name="jobTitleId">职位Id</param>
		Task<bool> Disabled(int jobTitleId);
		#endregion  成员方法
	}


}